import { Component, OnInit, HostListener } from '@angular/core';
import { LeftkeyListenerDirective } from '../shared/directive/leftkey-listener.directive';
import { MousedownListenerDirective } from '../shared/directive/mousedown-listener.directive';
import { TimeBusService } from '../shared/service/time-bus.service';

@Component({
  selector: 'app-button-group',
  templateUrl: './button-group.component.html',
  styleUrls: ['./button-group.component.css']
})
export class ButtonGroupComponent implements OnInit {

  isAMClick: Boolean = false;
  isPMClick: Boolean = false;
  isLeftKeyDown: Boolean;
  // timeArray = ['1:00-1:30', '1:30-2:00', '2:00-2:30', '2:30-3:00', '3:00-3:30', '3:30-4:00', '4:00-4:30', '4:30-5:00'];
  numberArray = [];
  selectedTime = [];
  timeArray: Array<number> = [];
  constructor(private timeBusService: TimeBusService) {
    this.isLeftKeyDown = false;
    for (let i = 1; i < 25; i++) {
      this.numberArray[i] = i;
    }
    this.timeBusService.timeZone.subscribe(data => {
      this.timeArray = data;
    });
  }
  ngOnInit() {

  }
  onAMClick(): void {
    this.isAMClick = true;
  }
  onPMClick(): void {
    this.isPMClick = true;
  }

  onLeftkeydown(): void {
    console.log('key down start....');
    this.isLeftKeyDown = true;
  }

  onLeftkeyup(): void {
    console.log('key up start....');
    this.isLeftKeyDown = false;
  }



}
